import Book.BookList;
import User.ManageUser;
import User.NomalUser;
import User.User;

import java.util.Scanner;

/**
 * Created with Intellij IDEA.
 * Description:
 * User: 33013
 * Date: 2023-02-28
 * Time: 12:15
 */
public class Main {

    public static User login(){
        System.out.println("请输入你的姓名：");
        Scanner scanner = new Scanner(System.in);
        String userName = scanner.nextLine();
        System.out.println("请输入你的身份：1-》管理员，0-》用户");
        int choice = scanner.nextInt();
        if (choice == 1) {
            return new ManageUser(userName);
        }else {
            return new NomalUser(userName);
        }
    }

    public static void main(String[] args) {
        BookList bookList = new BookList();
        User user = login();
        while(true){
            int choice = user.menu();
            user.doOperation(choice,bookList);
        }
    }
}
